<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateGridPriceTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('grid_price', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('grid_id')->default(0)->comment('网格id');
            $table->integer('street_id')->default(0)->comment('街道id');
            $table->integer('village_id')->default(0)->comment('村庄id');
            $table->integer('project_id')->default(0)->comment('项目id');
            $table->integer('segment_id')->default(0)->comment('号段id');
            $table->integer('type')->default(0)->comment('类型0签约1结算2银行3发放4查看');
            $table->decimal('subsidy_fee', 10, 2)->default(0)->comment('搬迁补助费');
            $table->decimal('transition_fee', 10, 2)->default(0)->comment('临时过渡费');
            $table->decimal('require_sign_fee', 10, 2)->default(0)->comment('规定时间签约奖励费');
            $table->decimal('require_clear_fee', 10, 2)->default(0)->comment('规定时间腾房奖励费');
            $table->decimal('if_decorate_fee', 10, 2)->default(0)->comment('简装/不简装补助费');
            $table->decimal('other_subsidy_fee', 10, 2)->default(0)->comment('奖励临时过渡费');
            $table->decimal('supply_total_fee', 10, 2)->default(0)->comment('总计补助费');
            $table->decimal('house_difference_fee', 10, 2)->default(0)->comment('房屋上下靠结算差额');
            $table->decimal('party_a_fee', 10, 2)->default(0)->comment('征收部门应支付被征收人费用');
            $table->decimal('party_b_fee', 10, 2)->default(0)->comment('被征收人应支付征收部门费用');
            $table->decimal('pay_fee', 10, 2)->default(0)->comment('支付费用');
            $table->timestamp('pay_time')->nullable()->comment('支付时间');
            $table->string('num')->default('')->comment('存单号');
            $table->string('imgs')->default('')->comment('照片');
            $table->integer('do_user_id')->default(0)->comment('操作者id');

            $table->decimal('stop_fee', 10, 2)->default(0)->comment('停产停业损失补偿金');
            $table->decimal('lack_area_fee', 10, 2)->default(0)->comment('不足45㎡结算差价');
            $table->decimal('money_fee', 10, 2)->default(0)->comment('货币补偿金');
            $table->decimal('yard_fee', 10, 2)->default(0)->comment('院落用地及附属物、构筑物补助费');
            $table->decimal('othe_build_fee', 10, 2)->default(0)->comment('院落用地土地使用权价值');
            $table->decimal('assess_fee', 10, 2)->default(0)->comment('评估补偿费');
            $table->decimal('use_fee', 10, 2)->default(0)->comment('土地使用权价值');
            $table->decimal('subsidiary_fee', 10, 2)->default(0)->comment('附着物补偿费');
            $table->timestamps();
            $table->softDeletes();
        });
        \Illuminate\Support\Facades\DB::statement("ALTER TABLE `grid_price` comment '网格关联价格表'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('grid_price');
    }
}
